4/16/2019
Work tends to go through a flow of steps.
How can we visualize this?
Micro$oft Visio?
Can we programmatically generate this?
One data source, multiple views
e.g.
Since I can't use department data … I'll use the process of making mealslurry
## # A tibble: 10 x 2 ## top.level.process process ## <chr> <chr> ## 1 acquire dry goods online shopping ## 2 acquire dry goods grocery store ## 3 acquire grocery goods grocery store ## 4 cooking lentils ## 5 cooking cook ## 6 cooking blend ## 7 portion prep jars ## 8 portion load jars ## 9 storage cool ## 10 storage fridge
Column names represent what it would be called coming from a departmental process document (a so-called RACI table, Responsible, Accountable, Consulted, Informed)
## 'data.frame': 33 obs. of 3 variables: ## $ top.level.process: chr "acquire dry goods" "acquire dry goods" "acquire dry goods" "acquire dry goods" ... ## $ process : chr "online shopping" "online shopping" "online shopping" "online shopping" ... ## $ task.definition : chr "buy crickets" "buy curry powder" "buy whey powder" "citric acid" ...
DiagrammeRpackage that uses Graphviz, mermaid, + .js libraries to make graph plots in R
create_nodes(nodes = mealslurry$process)
create_nodes(nodes = mealslurry$process)
Error in create_nodes(nodes = eat$process) : could not find function "create_nodes"
so sad
View post on imgur.com
piecing together documentation from the github page readme, a couple vignettes, and the manual
There doesn't seem to be documentation on how to go from tabular –> graph
Or ways to represent metadata over a set of nodes (like defining a group of connected nodes being part of a process), even thought it's present in Graphviz / DOT
A lot of functions serve to manipulate graph format data.
The majority of documentation / writing I encountered seemed to be using R as a Graphviz / DOT parser – writing a markup language and generating plots.
Here's the actual Graphviz page: https://graphviz.org/
Learning to use the package …
node_df + edge_df + create_graph = graph
Taking a subset of the larger process
cooking <- mealslurry %>% filter(top.level.process == "cooking")
node_dfn_cooking_tasks <- length(cooking$task.definition)
cooking_nodes <- create_node_df(n = n_cooking_tasks,
label = cooking$task.definition,
type = cooking$process, # not sure what this is
# defining my own var
top_level_process = cooking$top.level.process)
edges_dfcooking_edges <- create_edge_df(from = seq_len(n_cooking_tasks - 1),
to = 2:n_cooking_tasks)
create_graphcooking_graph <- create_graph(nodes_df = cooking_nodes,
edges_df = cooking_edges)
render_graphrender_graph(cooking_graph)
render_graphrender_graph(cooking_graph, layout = "kk")
render_graphrender_graph(cooking_graph, layout = "circle")
output = visNetworkrender_graph(cooking_graph, output = "visNetwork", layout = "circle")
… see more exploraton HTML for demo